package com.lk.lkappearance.service.impl;

import com.lk.lkappearance.common.AbstractBaseService;
import com.lk.lkappearance.mapper.UserRoleMapper;
import com.lk.lkappearance.model.User;
import com.lk.lkappearance.model.UserRoleKey;
import com.lk.lkappearance.service.UserRoleKeyService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Map;


public class UserRoleKeyServiceImpl extends AbstractBaseService implements UserRoleKeyService {

    @Autowired
    private UserRoleMapper userRoleMapper;

    /**
     * @param userRoleKey
     * @return
     */
    @Override
    public Map<String, Object> add(UserRoleKey userRoleKey) {
        try {
            userRoleMapper.insertSelective(userRoleKey);
        }catch (Exception e) {
            e.printStackTrace();
        }
        return success().getResult();
    }

    /**
     * @param userRoleKey
     * @return
     */
    @Override
    public Map<String, Object> modify(UserRoleKey userRoleKey) {
        try {
            //userRoleMapper.updateByPrimaryKeySelective(userRoleKey);
        }catch (Exception e) {
            e.printStackTrace();
        }
        return success().getResult();
    }

    /**
     * @param userRoleKey
     * @return
     */
    @Override
    public Map<String, Object> delete(UserRoleKey userRoleKey) {
        try {
            userRoleMapper.deleteByPrimaryKey(userRoleKey);
        }catch (Exception e) {
            e.printStackTrace();
        }
        return success().getResult();
    }
}
